package et.item.drill;

import ic2.api.item.ElectricItem;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.PotionEffect;
import net.minecraft.world.World;

/**
 * Created by winston_wang on 2017/6/29.
 */
public class ETItemWaterDrill extends ETItemDrill {
    public ETItemWaterDrill() {
        super(8.0f, 80.0f, 57000, 100, 1, 10, 17.0f);
        setTextureName("et:itemVoidWaterDrill");
        setUnlocalizedName("waterVoidDrill");
    }
    @Override
    public void onUpdate(ItemStack p_77663_1_, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) {
        if (p_77663_3_.isInWater()){
            ElectricItem.manager.charge(p_77663_1_,500,1,true,false);
            this.efficiencyOnProperMaterial=75.0f;
            if(p_77663_3_ instanceof EntityPlayer) {
                ((EntityPlayer) p_77663_3_).addPotionEffect(new PotionEffect(13, 1, 3));
                ((EntityPlayer) p_77663_3_).addPotionEffect(new PotionEffect(16, 1, 3));
            }
        }else {
            this.efficiencyOnProperMaterial=17.0f;
        }
    }
}
